package com.htgd.gardenexpo.entity;

import com.alibaba.fastjson.JSONArray;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;

import java.io.Serializable;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.UUID;

/**
 * @author ：hejing
 * @date ：Created in 2021/8/6 11:06
 * @description：发票实体类
 * @modified By：`
 * @version: 1.0
 */
@Component
@PropertySource("classpath:application.yml")
public class Bill implements Serializable {

    private static final long serialVersionUID = 9025840898384864525L;
    public static SimpleDateFormat sdf=new SimpleDateFormat("yyyyMMdd");
    public static SimpleDateFormat sd=new SimpleDateFormat("yyyyMMddHHmmss");
    /**
     * 消息类型
     */
    private String msgType="issue";
    /**
     * 消息ID
     */
    private String msgId= UUID.randomUUID().toString();
    /**
     * 消息来源
     */
    @Value("${bill.msgSrc}")
    private String msgSrc;
    /**
     * 请求时间
     */
    private String requestTimestamp=sd.format(new Date());
    /**
     * 预留信息
     */
    private String srcReserve="";
    /**
     * 发票材质
     */
    private String invoiceMaterial="ELECTRONIC";
    /**
     * 发票类型
     */
    private String invoiceType="PLAIN";
    /**
     * 商户号
     */
    @Value("${bill.merchantId}")
    private String merchantId;
    /**
     * 终端号
     */
    @Value("${bill.terminalId}")
    private String terminalId;
    /**
     * 门店号
     */
    private String storeId="";
    /**
     * 开票订单日期
     */
    private String merOrderDate= sdf.format(new Date());
    /**
     * 商户订单号
     */
    private String merOrderId="";
    /**
     * 买方名称
     */
    private String buyerName="";
    /**
     * 买方纳税人识别号
     */
    private String buyerTaxCode="";
    /**
     * 买方地址
     */
    private String buyerAddress="";
    /**
     * 买方电话
     */
    private String buyerTelephone="";
    /**
     * 买方开户行
     */
    private String buyerBank="";
    /**
     * 买方银行账号
     */
    private String buyerAccount="";
    /**
     * 含税总金额
     */
    private String amount="";
    /**
     * 扣除额
     */
    private String deductionAmount="";
    /**
     * 备注
     */
    private String remark="";
    /**
     * 推送手机号
     */
    private String notifyMobileNo="";
    /**
     * 推送邮箱
     */
    private String notifyEMail="";
    /**
     * 开票结果通知地址
     */
    private String notifyUrl="";
    /**
     * 商品明细
     */
    private String goodsDetail;


    public static SimpleDateFormat getSdf() {
        return sdf;
    }

    public static void setSdf(SimpleDateFormat sdf) {
        Bill.sdf = sdf;
    }

    public String getMsgType() {
        return msgType;
    }

    public void setMsgType(String msgType) {
        this.msgType = msgType;
    }

    public String getMsgId() {
        return msgId;
    }

    public void setMsgId(String msgId) {
        this.msgId = msgId;
    }

    public String getMsgSrc() {
        return msgSrc;
    }

    public void setMsgSrc(String msgSrc) {
        this.msgSrc = msgSrc;
    }

    public String getRequestTimestamp() {
        return requestTimestamp;
    }

    public void setRequestTimestamp(String requestTimestamp) {
        this.requestTimestamp = requestTimestamp;
    }

    public String getSrcReserve() {
        return srcReserve;
    }

    public void setSrcReserve(String srcReserve) {
        this.srcReserve = srcReserve;
    }

    public String getInvoiceMaterial() {
        return invoiceMaterial;
    }

    public void setInvoiceMaterial(String invoiceMaterial) {
        this.invoiceMaterial = invoiceMaterial;
    }

    public String getInvoiceType() {
        return invoiceType;
    }

    public void setInvoiceType(String invoiceType) {
        this.invoiceType = invoiceType;
    }

    public String getMerchantId() {
        return merchantId;
    }

    public void setMerchantId(String merchantId) {
        this.merchantId = merchantId;
    }

    public String getTerminalId() {
        return terminalId;
    }

    public void setTerminalId(String terminalId) {
        this.terminalId = terminalId;
    }

    public String getStoreId() {
        return storeId;
    }

    public void setStoreId(String storeId) {
        this.storeId = storeId;
    }

    public String getMerOrderDate() {
        return merOrderDate;
    }

    public void setMerOrderDate(String merOrderDate) {
        this.merOrderDate = merOrderDate;
    }

    public String getMerOrderId() {
        return merOrderId;
    }

    public void setMerOrderId(String merOrderId) {
        this.merOrderId = merOrderId;
    }

    public String getBuyerName() {
        return buyerName;
    }

    public void setBuyerName(String buyerName) {
        this.buyerName = buyerName;
    }

    public String getBuyerTaxCode() {
        return buyerTaxCode;
    }

    public void setBuyerTaxCode(String buyerTaxCode) {
        this.buyerTaxCode = buyerTaxCode;
    }

    public String getBuyerAddress() {
        return buyerAddress;
    }

    public void setBuyerAddress(String buyerAddress) {
        this.buyerAddress = buyerAddress;
    }

    public String getBuyerTelephone() {
        return buyerTelephone;
    }

    public void setBuyerTelephone(String buyerTelephone) {
        this.buyerTelephone = buyerTelephone;
    }

    public String getBuyerBank() {
        return buyerBank;
    }

    public void setBuyerBank(String buyerBank) {
        this.buyerBank = buyerBank;
    }

    public String getBuyerAccount() {
        return buyerAccount;
    }

    public void setBuyerAccount(String buyerAccount) {
        this.buyerAccount = buyerAccount;
    }

    public String getAmount() {
        return amount;
    }

    public void setAmount(String amount) {
        this.amount = amount;
    }

    public String getDeductionAmount() {
        return deductionAmount;
    }

    public void setDeductionAmount(String deductionAmount) {
        this.deductionAmount = deductionAmount;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public String getNotifyMobileNo() {
        return notifyMobileNo;
    }

    public void setNotifyMobileNo(String notifyMobileNo) {
        this.notifyMobileNo = notifyMobileNo;
    }

    public String getNotifyEMail() {
        return notifyEMail;
    }

    public void setNotifyEMail(String notifyEMail) {
        this.notifyEMail = notifyEMail;
    }

    public String getNotifyUrl() {
        return notifyUrl;
    }

    public void setNotifyUrl(String notifyUrl) {
        this.notifyUrl = notifyUrl;
    }

    public String getGoodsDetail() {
        return goodsDetail;
    }

    public void setGoodsDetail(String goodsDetail) {
        this.goodsDetail = goodsDetail;
    }

    @Override
    public String toString() {
        return "Bill{" +
                "msgType:'" + msgType + '\'' +
                ", msgId:'" + msgId + '\'' +
                ", msgSrc:'" + msgSrc + '\'' +
                ", requestTimestamp:'" + requestTimestamp + '\'' +
                ", srcReserve:'" + srcReserve + '\'' +
                ", invoiceMaterial:'" + invoiceMaterial + '\'' +
                ", invoiceType:'" + invoiceType + '\'' +
                ", merchantId:'" + merchantId + '\'' +
                ", terminalId:'" + terminalId + '\'' +
                ", storeId:'" + storeId + '\'' +
                ", merOrderDate:'" + merOrderDate + '\'' +
                ", merOrderId:'" + merOrderId + '\'' +
                ", buyerName:'" + buyerName + '\'' +
                ", buyerTaxCode:'" + buyerTaxCode + '\'' +
                ", buyerAddress:'" + buyerAddress + '\'' +
                ", buyerTelephone:'" + buyerTelephone + '\'' +
                ", buyerBank:'" + buyerBank + '\'' +
                ", buyerAccount:'" + buyerAccount + '\'' +
                ", amount:'" + amount + '\'' +
                ", deductionAmount:'" + deductionAmount + '\'' +
                ", remark:'" + remark + '\'' +
                ", notifyMobileNo:'" + notifyMobileNo + '\'' +
                ", notifyEMail:'" + notifyEMail + '\'' +
                ", notifyUrl:'" + notifyUrl + '\'' +
                ", goodsDetail:'" + goodsDetail + '\'' +
                '}';
    }
}
